package edu.tjut.web;

import java.math.BigDecimal;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import edu.tjut.dao.OrderDao;
import edu.tjut.domain.Order;

@RestController
public class OrderController {
	@Autowired
	private OrderDao orderDao;
	
	@PostMapping("/order")
	public List<Order> orderTest1(@RequestBody BigDecimal amount) {
		return orderDao.findByOrderTotalAmountGreaterThan(amount);
	}

	@PostMapping("/order1")
	public List<Order> orderTest2(@RequestBody int number) {
		return orderDao.findAllByOrderLines(number);
	}
}
